<?php


namespace App\Service;


use App\Helpers\Helper;
use Hyperf\Di\Annotation\Inject;
use Hyperf\View\Render;
use Psr\Http\Message\ResponseInterface;

class View extends Render
{
    /**
     * @Inject()
     * @var Helper
     */
    protected $helper;
    /**
     * @param string $template
     * @param array $data
     * @return ResponseInterface
     */
    public function render(string $template, array $data = []): ResponseInterface
    {
        $uinfo = \Hyperf\Utils\Context::get('uinfo');
        $menu = \Hyperf\Utils\Context::get('menu');
        $data['menu']=$menu;
        $data['uinfo']=$uinfo;
        $data['csrf']=$this->helper->getCsrf();

        return parent::render($template, $data); // TODO: Change the autogenerated stub
    }

}